﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="ProjectFileEdit.aspx.cs" Inherits="Honestysoft.Financing.WebUI.Module.Attach.ProjectFileEdit" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />
    <meta http-equiv="Pragma" content="no-cache" />
    <meta http-equiv="Cache-Control" content="no-cache" />
    <meta http-equiv="Expires" content="0" />
    <link rel="stylesheet" type="text/css" href="../../Styles/control.css" />
    <script language="javascript" type="text/javascript" src="../../Scripts/jquery-1.4.1.js"></script>
    <script language="javascript" type="text/javascript" src="../../Scripts/control.js"></script>
    <script language="javascript" type="text/javascript" src="../../Uploadify/js/jquery.min.js"></script>
    <link rel="Stylesheet" href="../../Uploadify/js/uploadify.css" />
    <script language="javascript" type="text/javascript" src="../../Uploadify/js/swfobject.js"></script> 
    <script language="javascript" type="text/javascript" src="../../Uploadify/js/jquery.uploadify.min.js"></script>
    <style type="text/css">
        div
        {
            font-size:12px;font-weight:700;
        }
    </style>
    <script language="javascript" type="text/javascript">
		//展开收起操作
		function change(objID) {
		    if (document.all("tb_" + objID).style.display == "block") {
		        document.all("img_" + objID).src = "../../images/ico_have2.gif";
		        document.all("img_" + objID).alt = "展开";
		        document.all("tb_" + objID).style.display = "none"
		    }
		    else {
		        document.all("img_" + objID).src = "../../images/ico_nohave2.gif";
		        document.all("img_" + objID).alt = "收起";
		        document.all("tb_" + objID).style.display = "block"
		    }
		}
        function expandAll() {
		    for (var i = 1; i <= 2; i++) {
		        document.all("img_" + i).src = "../../images/ico_nohave2.gif";
		        document.all("img_" + i).alt = "收起";
		        document.all("tb_" + i).style.display = "block";
		    }
		}
		function collapseAll() {
		    for (var i = 1; i <= 2; i++) {
		        document.all("img_" + i).src = "../../images/ico_have2.gif";
		        document.all("img_" + i).alt = "展开";
		        document.all("tb_" + i).style.display = "none"
		    }
		}
    </script>
    
</head>
<body style="margin:10px">
    <form id="form1" runat="server">
    <div style="text-align:right"><input type="button" value="关 闭" onclick="window.close();"  class="btn_normal" 
			onMouseOver="this.className='btn_active'" 
            onMouseOut="this.className='btn_normal'" /></div>
            <asp:Button runat="server" ID="btnRebind" onclick="btnRebind_Click" style="display:none" />
    <div style="text-align:center;margin-top:4px">
       项目档案管理
    </div>
    <div>
        <a href="#" onclick="expandAll();">全部展开</a>&nbsp;&nbsp;<a href="#" onclick="collapseAll();">全部收缩</a>
    </div>
    
    <div>
         <img id="img_1" alt="收起" onclick="change('1')" style="vertical-align:middle" src="../../images/ico_nohave2.gif" />
         <span style="vertical-align:middle;cursor:hand" onclick="change('1')">一、项目基本情况</span>
    </div>
    <table cellpadding="0" cellspacing="0" border="1" class="tEdit" width="100%"  id="tb_1" style="display: block;" >
		<tr>
			<td class="title1" width="120px" style="text-align:left" >项目名称</td>
			<td width="280px"><asp:Label runat="server" ID="lblProjectName"></asp:Label></td>
			<td  class="title1" width="120px" style="text-align:left" >项目编号</td>
			<td width="280px"><asp:Label runat="server" ID="lblProjectSN"></asp:Label></td>
		</tr>
		<tr>
			<td class="title1"  style="text-align:left" >项目单位</td>
			<td><asp:Label runat="server" ID="lblOwner971"></asp:Label></td>
			<td class="title1"  style="text-align:left" >建设单位</td>
			<td><asp:Label runat="server" ID="lblOwner"></asp:Label></td>
		</tr>
    </table>
    <div>
        <img id="img_2" alt="收起" onclick="change('2')" style="vertical-align:middle" src="../../images/ico_nohave2.gif" />
        <span style="vertical-align:middle;cursor:hand" onclick="change('2')">二、项目档案列表</span>
    </div> 
    <table cellpadding="0" cellspacing="0" border="1" class="tEdit"   id="tb_2" style="display: block;font-family:宋体;font-size:12px" >
        <thead>
           <th style="width:200px">档案名称</th>
           <th>文件名</th>
           <th style="width:32px">图标</th>
           <th style="width:50px">类型</th>
           <th style="width:80px">大小</th>
           <th style="width:70px">操作</th>
        </thead>
        <tr>
            <td colspan="6">
                一、项目审批情况汇总表（附件2）</td>
        </tr>
        <asp:Repeater runat="server" ID="rptAtt2">
            <ItemTemplate>
            <tr>
                <td class="title1" style="text-align:left;height:30px;">&nbsp;&nbsp;&nbsp;&nbsp;<%# DataBinder.Eval(Container.DataItem,"Description") %></td>
                <td style="text-align:left"><%# GetTextUrl(DataBinder.Eval(Container.DataItem, "FileName") + "", DataBinder.Eval(Container.DataItem, "Extension") + "", DataBinder.Eval(Container.DataItem, "Path") + "")%></td>
                <td style="text-align:center"><%#GetIcon( DataBinder.Eval(Container.DataItem,"Extension")+"") %></td>
                <td style="text-align:center"><%#  DataBinder.Eval(Container.DataItem,"Extension") %></td>
                <td style="text-align:center"><%# DataBinder.Eval(Container.DataItem, "Size") + "" == "0" ? "" : Honestysoft.BaseLibrary.Common.StringHelper.FormatFileSize(Convert.ToInt64( DataBinder.Eval(Container.DataItem, "Size")))%></td>
                <td>
                    <script type="text/javascript">
                        $(document).ready(function () {
                            $("#uploadify<%# DataBinder.Eval(Container.DataItem,"ID") %>").uploadify({
                                'uploader': '../../Uploadify/js/uploadify.swf',
                                'script': 'Json/UploadProjectDocument.ashx?DataID=<%=Request["ID"] %>|<%# DataBinder.Eval(Container.DataItem,"AttachmentBuType") %>',
                                'cancelImg': '../../Uploadify/js/cancel.png',
                                'folder': '',
                                'wmode': 'transparent ',
                                'queueID': 'fileQueue<%# DataBinder.Eval(Container.DataItem,"ID") %>',
                                'auto': true,
                                'multi': false,
                                'width': 66,
                                'height': 16,
                                'buttonImg': '../../Uploadify/images/addAtt3.png',
                                'onComplete': function (event, queueID, fileObj, response, data) {
                                },
                                'onAllComplete': function (event, data) {
                                    document.getElementById('<%=btnRebind.ClientID %>').click();
                                },
                                'onSelect': function (e, queueId, fileObj) {
                                }
                            });
                        });
                    </script> 
                    <input type="file" name="uploadify<%# DataBinder.Eval(Container.DataItem,"ID") %>" id="uploadify<%# DataBinder.Eval(Container.DataItem,"ID") %>" />
                    <div id="fileQueue<%# DataBinder.Eval(Container.DataItem,"ID") %>"></div>
                    
                </td>
            </tr>
            </ItemTemplate>
        </asp:Repeater>
        <tr>
            <td colspan="6">
                二、资本金到位情况汇总表（附件3）</td>
        </tr>
        <asp:Repeater runat="server" ID="rptAtt3">
            <ItemTemplate>
            <tr>
                <td class="title1" style="text-align:left;height:30px;">&nbsp;&nbsp;&nbsp;&nbsp;<%# DataBinder.Eval(Container.DataItem,"Description") %></td>
                <td style="text-align:left;vertical-align:middle;"><%# GetTextUrl(DataBinder.Eval(Container.DataItem, "FileName") + "", DataBinder.Eval(Container.DataItem, "Extension") + "", DataBinder.Eval(Container.DataItem, "Path") + "")%></td>
                <td style="text-align:center"><%#GetIcon( DataBinder.Eval(Container.DataItem,"Extension")+"") %></td>
                <td style="text-align:center"><%# DataBinder.Eval(Container.DataItem,"Extension") %></td>
                <td style="text-align:center"><%# DataBinder.Eval(Container.DataItem, "Size") + "" == "0" ? "" : Honestysoft.BaseLibrary.Common.StringHelper.FormatFileSize(Convert.ToInt64( DataBinder.Eval(Container.DataItem, "Size")))%></td>
                <td>
                
                    <script type="text/javascript">
                        $(document).ready(function () {
                            $("#uploadify<%# DataBinder.Eval(Container.DataItem,"ID") %>").uploadify({
                                'uploader': '../../Uploadify/js/uploadify.swf',
                                'script': 'Json/UploadProjectDocument.ashx?DataID=<%=Request["ID"] %>|<%# DataBinder.Eval(Container.DataItem,"AttachmentBuType") %>',
                                'cancelImg': '../../Uploadify/js/cancel.png',
                                'folder': '',
                                'wmode': 'transparent ',
                                'queueID': 'fileQueue<%# DataBinder.Eval(Container.DataItem,"ID") %>',
                                'auto': true,
                                'multi': false,
                                'width': 66,
                                'height': 16,
                                'buttonImg': '../../Uploadify/images/addAtt3.png',
                                'onComplete': function (event, queueID, fileObj, response, data) {
                                },
                                'onAllComplete': function (event, data) {

                                },
                                'onSelect': function (e, queueId, fileObj) {
                                }
                            });
                        });
                    </script> 
                    <input type="file" name="uploadify<%# DataBinder.Eval(Container.DataItem,"ID") %>" id="uploadify<%# DataBinder.Eval(Container.DataItem,"ID") %>" />
                    <div id="fileQueue<%# DataBinder.Eval(Container.DataItem,"ID") %>"></div>
                    
                </td>
            </tr>
             </ItemTemplate>
        </asp:Repeater>
    </table>
    <asp:HiddenField runat="server" ID="hidForOpen" />
    <script language="javascript" type="text/javascript">
        var tab = document.getElementById('tb_2');
        if (tab != null) {
            for (var i = 1; i < tab.rows.length; i++) {//去掉表头
                tab.rows[i].onmouseout = function () { this.className = ""; }
                tab.rows[i].onmouseover = function () { this.className = "a2"; }
            }
        }
        if (document.getElementById("<%=hidForOpen.ClientID %>").value != "") {
            window.open(document.getElementById("<%=hidForOpen.ClientID %>").value);
            document.getElementById("<%=hidForOpen.ClientID %>").value = "";
        }
    </script>
    </form>
</body>
</html>
